#include <future>
#include <iostream>

int main() {
    try {
        std::future<int> f = std::async([]() { throw std::runtime_error("Error"); return 0; });
        f.get();
    } catch (const std::exception &e) {
        std::cout << "Caught exception: " << e.what() << std::endl;
    }

    return 0;
}